package com.example.baserecyclerviewadapterdemo.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.baserecyclerviewadapterdemo.R;
import com.example.baserecyclerviewadapterdemo.entity.Status;

import org.jetbrains.annotations.NotNull;

public class EmptyViewAdapter extends BaseQuickAdapter<Status, BaseViewHolder> {
    public EmptyViewAdapter() {
        super(R.layout.layout_animation);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, Status status) {
        switch (holder.getLayoutPosition() % 3) {
            case 0:
                holder.setImageResource(R.id.img,R.mipmap.animation_img1);
                break;
            case 1:
                holder.setImageResource(R.id.img,R.mipmap.animation_img2);
                break;
            case 2:
                holder.setImageResource(R.id.img,R.mipmap.animation_img3);
                break;
            default:
                break;
        }
        holder.setText(R.id.tweetName,"Flutter " + holder.getLayoutPosition() + 1);
        holder.setText(R.id.tweetText,"谷歌今天宣布推出 Flutter 2，距离 Flutter 1.0 的发布才过去两年多，在这不算长的时间里，Flutter 团队处理了 24541 个 issue，合并了 17039 个 PR。");
    }
}
